From 0947f260d8f61dae21638ce6a8d731bfda14cf7b Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Fri, 22 Oct 2010 15:14:51 +0100 Subject: [PATCH] libxc: convert mca interface over to hypercall buffers Signed-off-by: Ian Campbell Signed-off-by: Ian Jackson --- tools/libxc/xc_misc.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c index e205dc0804..6995dcc4cd 100644 --- a/tools/libxc/xc_misc.c +++ b/tools/libxc/xc_misc.c @@ -167,18 +167,19 @@ int xc_mca_op(xc_interface *xch, struct xen_mc *mc) { int ret = 0; DECLARE_HYPERCALL; + DECLARE_HYPERCALL_BOUNCE(mc, sizeof(*mc), XC_HYPERCALL_BUFFER_BOUNCE_BOTH); - mc->interface_version = XEN_MCA_INTERFACE_VERSION; - if ( lock_pages(xch, mc, sizeof(*mc)) ) + if ( xc_hypercall_bounce_pre(xch, mc) ) { - PERROR("Could not lock xen_mc memory"); - return -EINVAL; + PERROR("Could not bounce xen_mc memory buffer"); + return -1; } + mc->interface_version = XEN_MCA_INTERFACE_VERSION; hypercall.op = __HYPERVISOR_mca; - hypercall.arg[0] = (unsigned long)mc; + hypercall.arg[0] = HYPERCALL_BUFFER_AS_ARG(mc); ret = do_xen_hypercall(xch, &hypercall); - unlock_pages(xch, mc, sizeof(*mc)); + xc_hypercall_bounce_post(xch, mc); return ret; } #endif -- 2.30.2